package com.reverie.controller;

import com.reverie.common.pojo.CommonResult;
import com.reverie.entity.Region;
import com.reverie.service.IRegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Rui.Zhou
 * @since 2024-02-03
 */
@RestController
@RequestMapping("/region")
public class RegionController {

    @Autowired
    private IRegionService regionService;

    @PostMapping("queryTree")
    public CommonResult<List<Region>> queryTree(){
        return CommonResult.data(regionService.queryTree());
    }

}
